package com.zwim.common.enums;

/**
 * 通讯协议
 * @author zhenjiang.gong
 * @date
 */
public enum TransportEnum {
    WEBSOCKET("websocket"),
    POLLING("polling");

    private final String value;

    TransportEnum(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static TransportEnum byName(String value) {
        for (TransportEnum t : TransportEnum.values()) {
            if (t.getValue().equals(value)) {
                return t;
            }
        }
        throw new IllegalArgumentException("Can't find " + value + " transport");
    }
}
